package com.zhtkj.constant;

import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
import java.util.Map;

import com.zhtkj.util.Point;

/** 
* @ClassName: FenceConstant 
* @Description: 保存电子围栏信息 
* @author mafeng 
* @date 2017年9月7日 上午9:20:55 
*  
*/
public class FenceConstant {

	//静态变量（写死的，从数据库拷贝过来的）
	public static Map<Long, List<Point>> districtMap; //长沙市内五区电子围栏
	
	public static List<Point> secondLoopLine = new ArrayList<Point>(); //二环线
	
	public static List<Point> thirdLoopLine = new ArrayList<Point>(); //三环线
	
	
	//实例变量
	private Map<Long, List<Point>> consappMap; //工地围栏，key:工地gpsfence id，value:工地围栏坐标点List
	
	private Map<Long, List<Point>> unloadingMap; //卸区围栏，key:卸区gpsfence id，value:卸区围栏坐标点List
	
	private Map<Long, List<Point>> restrictMap; //禁区围栏，key:禁区gpsfence id，value:禁区围栏坐标点List
	
	private Map<Long, List<Point>> parkingMap; //停车场围栏，key:卸区gpsfence id，value:卸区围栏坐标点List
	
	private Map<Long, List<Point>> lineMap; //路线围栏，key:路线gpsfence id，value:路线围栏坐标点List
	
	private Map<Long, List<Point>> consappInfoMap; //工地围栏，key:工地id，value:工地围栏坐标点List 注意和上面的区别
	
	private Map<Long, List<Point>> unloadingInfoMap; //卸区围栏，key:卸区id，value:卸区围栏坐标点List 注意和上面的区别
	
	static {
		districtMap = new Hashtable<Long, List<Point>>();
		
		String furong = "112.994358,28.209642;112.987231,28.207340;112.985830,28.201345;112.970846,28.203883;112.970764,28.190130;113.012260,28.187667;113.038685,28.190044;113.044331,28.193329;113.067501,28.177782;113.076785,28.175977;113.101291,28.185889;113.099304,28.194513;113.106756,28.202024;113.104106,28.206565;113.088108,28.214299;113.057638,28.219643;113.053085,28.224685;113.034154,28.217848;113.021160,28.222435;113.005416,28.220021;113.002120,28.222083;112.995755,28.216655;113.001155,28.209906;112.994358,28.209642";
		String tianxin = "112.960455,28.199210;112.949349,28.120761;112.943616,28.110894;112.925470,28.093705;112.921842,28.083327;112.923915,28.062422;112.940990,28.035747;112.945631,28.042580;112.971051,28.059724;112.975325,28.059543;112.982338,28.050025;112.988062,28.048903;112.991807,28.065903;113.005606,28.076636;113.004705,28.082305;112.997036,28.083798;113.000433,28.088777;112.990861,28.113117;112.990945,28.116565;112.998986,28.118736;113.000765,28.122805;112.994694,28.125493;112.998488,28.126309;112.998885,28.132316;112.988220,28.150636;112.980941,28.148349;112.979653,28.151597;112.981297,28.189137;112.970764,28.190130;112.970885,28.198835;112.960455,28.199210";
		String yuelu = "112.960437,28.199077;112.965348,28.254500;112.950515,28.293800;112.953882,28.276653;112.947161,28.272815;112.933451,28.270759;112.915899,28.277948;112.897177,28.264306;112.882373,28.259283;112.869632,28.260475;112.869530,28.252446;112.862351,28.244651;112.850468,28.241014;112.841146,28.232917;112.837218,28.219126;112.838136,28.214046;112.846998,28.210068;112.849142,28.195550;112.855102,28.189351;112.851355,28.185052;112.852528,28.180594;112.838372,28.176719;112.840987,28.170570;112.849426,28.167824;112.848637,28.161213;112.854103,28.157385;112.870884,28.157419;112.873250,28.163973;112.881957,28.164891;112.885150,28.171897;112.890186,28.171396;112.894828,28.167559;112.893712,28.156696;112.906382,28.154632;112.913231,28.136788;112.924732,28.134410;112.930972,28.136609;112.936899,28.129849;112.943874,28.128605;112.944026,28.121913;112.950999,28.126446;112.960437,28.199077";
		String kaifu = "112.970870,28.199031;112.970846,28.203883;112.985830,28.201345;112.989296,28.209286;113.000906,28.209637;112.995755,28.216655;113.001456,28.221893;113.021160,28.222435;113.034154,28.217848;113.053085,28.224685;113.050165,28.230024;113.053438,28.245576;113.047562,28.251065;113.047804,28.259210;113.027221,28.263886;113.039759,28.288454;113.058781,28.307027;113.054551,28.310734;113.058396,28.312653;113.060376,28.320660;113.057675,28.329477;113.067327,28.335006;113.074727,28.352736;113.079137,28.353356;113.078629,28.364028;113.070848,28.368318;113.069047,28.361205;113.059602,28.359741;113.058700,28.367082;113.052038,28.367595;113.010526,28.389061;112.993377,28.382231;112.981827,28.384054;112.979565,28.391360;112.959326,28.384454;112.953896,28.381489;112.948675,28.360774;112.921101,28.349367;112.913927,28.339492;112.914900,28.331630;112.945508,28.302986;112.961085,28.271252;112.965573,28.244897;112.960455,28.199210;112.970870,28.199031";
		String yuhua = "112.981126,28.186963;112.979707,28.151395;112.980941,28.148349;112.988220,28.150636;112.998943,28.132132;112.998488,28.126309;112.994869,28.125038;113.000955,28.123343;112.998986,28.118736;112.990721,28.115561;113.000433,28.088777;112.997036,28.083798;113.004705,28.082305;113.005606,28.076636;113.019607,28.065298;113.034060,28.062332;113.039743,28.052055;113.046155,28.048190;113.055867,28.050195;113.064512,28.074142;113.083212,28.076654;113.082090,28.084509;113.071077,28.099647;113.081717,28.122194;113.069152,28.142718;113.071711,28.160923;113.085342,28.173392;113.106994,28.171432;113.107855,28.179192;113.101291,28.185889;113.083802,28.177749;113.071226,28.176926;113.044331,28.193329;113.038685,28.190044;112.981297,28.189137;112.981126,28.186963";
		
		String[] array = furong.split(";");
		List<Point> polygon = new ArrayList<Point>();
		for (String poi: array) {
			Point point = new Point(Double.parseDouble(poi.split(",")[0]), Double.parseDouble(poi.split(",")[1]));
			polygon.add(point);
		}
		districtMap.put(22L, polygon);
		
		array = tianxin.split(";");
		polygon = new ArrayList<Point>();
		for (String poi: array) {
			Point point = new Point(Double.parseDouble(poi.split(",")[0]), Double.parseDouble(poi.split(",")[1]));
			polygon.add(point);
		}
		districtMap.put(19L, polygon);
		
		array = yuelu.split(";");
		polygon = new ArrayList<Point>();
		for (String poi: array) {
			Point point = new Point(Double.parseDouble(poi.split(",")[0]), Double.parseDouble(poi.split(",")[1]));
			polygon.add(point);
		}
		districtMap.put(18L, polygon);
		
		array = kaifu.split(";");
		polygon = new ArrayList<Point>();
		for (String poi: array) {
			Point point = new Point(Double.parseDouble(poi.split(",")[0]), Double.parseDouble(poi.split(",")[1]));
			polygon.add(point);
		}
		districtMap.put(20L, polygon);
		
		array = yuhua.split(";");
		polygon = new ArrayList<Point>();
		for (String poi: array) {
			Point point = new Point(Double.parseDouble(poi.split(",")[0]), Double.parseDouble(poi.split(",")[1]));
			polygon.add(point);
		}
		districtMap.put(21L, polygon);
		
		//初始化环线坐标数据
		String erHuan = "112.946786,28.274068;112.979385,28.290557;112.994317,28.296206;113.002944,28.297052;113.009273,28.290308;113.012144,28.276763;113.013275,28.253067;113.014996,28.246924;113.012691,28.236784;113.013846,28.221741;113.013870,28.196791;113.009856,28.162227;113.007552,28.156157;112.993742,28.150573;112.985122,28.149687;112.958774,28.141550;112.926788,28.143403;112.926230,28.160219;112.917063,28.169345;112.915341,28.175204;112.919352,28.186161;112.912454,28.197365;112.910134,28.217741;112.911853,28.228172;112.920467,28.250327;112.941068,28.264050;112.946786,28.274068";
		String sanHuan = "112.959968,28.331289;112.945132,28.322442;112.922855,28.303848;112.917697,28.302302;112.898711,28.308015;112.885435,28.309751;112.858888,28.300404;112.849668,28.270360;112.849648,28.245920;112.845621,28.230104;112.849661,28.209769;112.858892,28.189415;112.878521,28.175968;112.879675,28.167796;112.874468,28.152587;112.883117,28.135626;112.891771,28.122224;112.903879,28.117982;112.929703,28.110869;112.955419,28.089829;112.975431,28.094518;113.008190,28.084836;113.024859,28.087617;113.039768,28.088063;113.058630,28.096923;113.095280,28.095295;113.120073,28.103710;113.166798,28.118739;113.154748,28.157390;113.155897,28.188982;113.155318,28.192545;113.148949,28.224626;113.150113,28.258230;113.148978,28.280124;113.146673,28.290820;113.135118,28.306704;113.098163,28.307693;113.066627,28.320136;113.026564,28.326469;112.995519,28.321428;112.959968,28.331289";
		array = erHuan.split(";");
		for (String poi: array) {
			Point point = new Point(Double.parseDouble(poi.split(",")[0]), Double.parseDouble(poi.split(",")[1]));
			secondLoopLine.add(point);
		}
		array = sanHuan.split(";");
		for (String poi: array) {
			Point point = new Point(Double.parseDouble(poi.split(",")[0]), Double.parseDouble(poi.split(",")[1]));
			thirdLoopLine.add(point);
		}
	}
	
	public FenceConstant() {
		this.restrictMap = new Hashtable<Long, List<Point>>();
		this.consappMap = new Hashtable<Long, List<Point>>();
		this.unloadingMap = new Hashtable<Long, List<Point>>();
		this.parkingMap = new Hashtable<Long, List<Point>>();
		this.lineMap = new Hashtable<Long, List<Point>>();
		this.consappInfoMap = new Hashtable<Long, List<Point>>();
		this.unloadingInfoMap = new Hashtable<Long, List<Point>>();
	}

	public Map<Long, List<Point>> getRestrictMap() {
		return restrictMap;
	}

	public void setRestrictMap(Map<Long, List<Point>> restrictMap) {
		this.restrictMap = restrictMap;
	}

	public Map<Long, List<Point>> getConsappMap() {
		return consappMap;
	}

	public void setConsappMap(Map<Long, List<Point>> consappMap) {
		this.consappMap = consappMap;
	}

	public Map<Long, List<Point>> getUnloadingMap() {
		return unloadingMap;
	}

	public void setUnloadingMap(Map<Long, List<Point>> unloadingMap) {
		this.unloadingMap = unloadingMap;
	}

	public Map<Long, List<Point>> getParkingMap() {
		return parkingMap;
	}

	public void setParkingMap(Map<Long, List<Point>> parkingMap) {
		this.parkingMap = parkingMap;
	}

	public Map<Long, List<Point>> getLineMap() {
		return lineMap;
	}

	public void setLineMap(Map<Long, List<Point>> lineMap) {
		this.lineMap = lineMap;
	}

	public Map<Long, List<Point>> getConsappInfoMap() {
		return consappInfoMap;
	}

	public void setConsappInfoMap(Map<Long, List<Point>> consappInfoMap) {
		this.consappInfoMap = consappInfoMap;
	}

	public Map<Long, List<Point>> getUnloadingInfoMap() {
		return unloadingInfoMap;
	}

	public void setUnloadingInfoMap(Map<Long, List<Point>> unloadingInfoMap) {
		this.unloadingInfoMap = unloadingInfoMap;
	}
	
}